<template>
	<view class="loginRigster">
		<view class="loginRigster-title ff-color-222 ff-font-25 ff-font-weight-600">请选择注册角色</view>
		<view class="loginRigster-box ff-align-items-one ff-border-radius-10 ff-margin-bottom-16" @click="unitClick">
			<image src="https://fire-system.oss-cn-beijing.aliyuncs.com/web/fire-technology/reg-1.png" mode=""></image>
			<view>
				<view class="ff-font-weight-600 ff-margin-bottom-10 ff-font-18">社会单位</view>
				<view class="ff-font-13">我要发布需求并完善信息</view>
			</view>
		</view>
		<view class="loginRigster-box ff-align-items-one ff-border-radius-10 ff-margin-bottom-16"
			@click="unitStaffClick">
			<image src="https://fire-system.oss-cn-beijing.aliyuncs.com/web/fire-technology/reg-2.png" mode=""></image>
			<view>
				<view class="ff-font-weight-600 ff-margin-bottom-10 ff-font-18">社会单位员工</view>
				<view class="ff-font-13">我要发布需求并完善信息</view>
			</view>
		</view>
		<view v-if="false">
			<view class="loginRigster-box ff-align-items-one ff-border-radius-10 ff-margin-bottom-16 ff-opacity-5"
				@click="noRegClick(1)">
				<image src="https://fire-system.oss-cn-beijing.aliyuncs.com/web/fire-technology/reg-3.png" mode="">
				</image>
				<view>
					<view class="ff-font-weight-600 ff-margin-bottom-10 ff-font-18">技术服务机构</view>
					<view class="ff-font-13">我能参与需求响应并提供服务</view>
				</view>
			</view>
			<view class="loginRigster-box ff-align-items-one ff-border-radius-10 ff-margin-bottom-16 ff-opacity-5"
				@click="noRegClick(2)">
				<image src="https://fire-system.oss-cn-beijing.aliyuncs.com/web/fire-technology/reg-4.png" mode="">
				</image>
				<view>
					<view class="ff-font-weight-600 ff-margin-bottom-10 ff-font-18">技术服务机构员工</view>
					<view class="ff-font-13">我能参与需求响应并提供服务</view>
				</view>
			</view>
		</view>
		<!-- // 参数：{{userInfo}}
		// {{currentPage}} -->
		<u-modal v-model="locationModal" title="温馨提示" :content-style="{ 'line-height': '1.5' }"
			:content="noRegContent" />
	</view>
</template>

<script>
	export default {
		name: 'loginRister',
		data() {
			return {
				locationModal: false, // 提示框的显/隐
				noRegContent: '',
				userInfo: '',
				currentPage: ''
			};
		},
		onShow(e) {
			console.log('参数', e)
			this.userInfo = JSON.stringify(e)
			const pages = getCurrentPages(); // 获取当前页面栈
			const currentPage = pages[pages.length - 1].$page.fullPath; // 获取当前页面路径11
			let result = currentPage.split("=")[1]; // 使用split分割后，取数组的第二个元素（索引为1）
			console.log(result); // 输出：data
			this.currentPage = result
		},
		methods: {
			// 单位注册
			unitClick() {
				this.$pageJump.navigateTo('/pages/loginRegister/register/socialUnit/unit/unitRegisterSearch');
			},
			// 单位员工注册
			unitStaffClick() {
				this.$pageJump.navigateTo('/pages/loginRegister/register/socialUnit/staff/staffRegisterSearch');
			},
			//机构管理元和机构员工暂时不提供注册
			noRegClick(code) {
				if (code == 1) {
					this.noRegContent = '技术服务机构暂不支持注册！';
				} else if (code == 2) {
					this.noRegContent = '技术服务机构员工暂不支持注册！';
				}
				this.locationModal = true;
			}
		},
		onShareAppMessage() {
			return {
				title: '分享小程序给朋友',
				path: '/pages/homePage/Home'
			};
		}
	};
</script>

<style lang="scss">
	page {
		background-color: #ffffff;
	}

	.loginRigster {
		margin: 62rpx;

		&-title {
			margin: 97rpx 0 56rpx;
		}

		&-box {
			padding: 36rpx 44rpx 26rpx 52rpx;
			background-color: #f5f6fa;

			image {
				width: 100rpx;
				height: 100rpx;
				margin-right: 69rpx;
			}

			.ff-font-13 {
				color: #bcbfcc;
			}
		}
	}
</style>